package com.fangcang.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.fangcang.service.DemoService;

@RestController
public class DemoController {

	@Resource(name = "demoService")
	private DemoService service;

	@RequestMapping("/test")
	public Map<String, String> test() {

		Map<String, String> map = service.getData();
		String jsonString = JSONObject.toJSONString(map);
		System.out.println(jsonString);

		System.out.println(JSONObject.parseObject(jsonString));
		if (map.isEmpty()) {
			System.out.println(123);
		}
		return map;
	}
	
}
